package students;
// Student类的定义
class Student {
    private final String name;       // 姓名
    private String studentId;  // 学号
    private String clazz;      // 班级
    private String gender;     // 性别
    private int age;           // 年龄
    private String personality; // 性格

    // 构造函数，用于初始化学生信息
    public Student(String name, String studentId, String clazz, String gender, int age, String personality) {
        this.name = name;
        this.studentId = studentId;
        this.clazz = clazz;
        this.gender = gender;
        this.age = age;
        this.personality = personality;
    }

    // 信息概要：将所有属性信息组合成一个有意义的字符串输出
    public String getInfoSummary() {
        return "姓名: " + name + "\n" +
                "学号: " + studentId + "\n" +
                "班级: " + clazz + "\n" +
                "性别: " + gender + "\n" +
                "年龄: " + age + "\n" +
                "性格: " + personality;
    }
}

public class zuoye {
    public static void main(String[] args) {
        // 创建三个Student对象
        Student stu1 = new Student("小明", "2023123", "地理信息科学班", "男", 20, "外向");
        Student stu2 = new Student("小美", "2024456", "土地资源管理", "女", 19, "内向");
        Student stu3 = new Student("李华", "2022678", "人文地理与城乡规划班", "男", 21, "活泼");

        // 输出每个学生的信息概要
        System.out.println("学生1的信息：\n" + stu1.getInfoSummary());
        System.out.println();

        System.out.println("学生2的信息：\n" + stu2.getInfoSummary());
        System.out.println();

        System.out.println("学生3的信息：\n" + stu3.getInfoSummary());
    }
}
